home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / windows 95 utilities / programming tools / freeman installer / iconobj.h_ / iconobj
Text File  |  1995-09-17  |  472b  |  38 lines

  1. #define STRICT
  2.  
  3.  
  4. extern HINSTANCE inst;
  5.  
  6.  
  7. class iconobj
  8. {
  9.    HICON icon;
  10.  
  11.    public:
  12.  
  13.    iconobj()
  14.    {
  15.       icon = 0;
  16.    }
  17.   ~iconobj()
  18.    {
  19.       if (icon != 0)
  20.       {
  21.          DestroyIcon(icon);
  22.       }
  23.    }
  24.    int load(int id)
  25.    {
  26.       return load((char*)MAKEINTRESOURCE(id));
  27.    }
  28.    int load(char iconname[])
  29.    {
  30.       return (icon = LoadIcon(inst, iconname)) != 0;
  31.    }
  32.    operator HICON()
  33.    {
  34.       return icon;
  35.    }
  36. };
  37.  
  38.